package com.senlingspace.system.service.impl;

import java.util.List;
import com.senlingspace.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.senlingspace.system.mapper.SlkjProductAttributeMapper;
import com.senlingspace.system.domain.SlkjProductAttribute;
import com.senlingspace.system.service.ISlkjProductAttributeService;

/**
 * 商品属性Service业务层处理
 *
 * @author 秋意浓
 * @date 2024-10-28
 */
@Service
public class SlkjProductAttributeServiceImpl implements ISlkjProductAttributeService
{
    @Autowired
    private SlkjProductAttributeMapper slkjProductAttributeMapper;

    /**
     * 查询商品属性
     *
     * @param id 商品属性主键
     * @return 商品属性
     */
    @Override
    public SlkjProductAttribute selectSlkjProductAttributeById(Long id)
    {
        return slkjProductAttributeMapper.selectSlkjProductAttributeById(id);
    }

    /**
     * 查询商品属性列表
     *
     * @param slkjProductAttribute 商品属性
     * @return 商品属性
     */
    @Override
    public List<SlkjProductAttribute> selectSlkjProductAttributeList(SlkjProductAttribute slkjProductAttribute)
    {
        return slkjProductAttributeMapper.selectSlkjProductAttributeList(slkjProductAttribute);
    }

    /**
     * 新增商品属性
     *
     * @param slkjProductAttribute 商品属性
     * @return 结果
     */
    @Override
    public int insertSlkjProductAttribute(SlkjProductAttribute slkjProductAttribute)
    {
        slkjProductAttribute.setCreateTime(DateUtils.getNowDate());
        return slkjProductAttributeMapper.insertSlkjProductAttribute(slkjProductAttribute);
    }

    /**
     * 修改商品属性
     *
     * @param slkjProductAttribute 商品属性
     * @return 结果
     */
    @Override
    public int updateSlkjProductAttribute(SlkjProductAttribute slkjProductAttribute)
    {
        slkjProductAttribute.setUpdateTime(DateUtils.getNowDate());
        return slkjProductAttributeMapper.updateSlkjProductAttribute(slkjProductAttribute);
    }

    /**
     * 批量删除商品属性
     *
     * @param ids 需要删除的商品属性主键
     * @return 结果
     */
    @Override
    public int deleteSlkjProductAttributeByIds(Long[] ids)
    {
        return slkjProductAttributeMapper.deleteSlkjProductAttributeByIds(ids);
    }

    /**
     * 删除商品属性信息
     *
     * @param id 商品属性主键
     * @return 结果
     */
    @Override
    public int deleteSlkjProductAttributeById(Long id)
    {
        return slkjProductAttributeMapper.deleteSlkjProductAttributeById(id);
    }
}
